﻿* Encoding: UTF-8.

********************************************
* In-group cue paper
********************************************

********************************************
* Data cleaning 2
********************************************

******************************************************************
* STEP 1: Partisanship
******************************************************************

* Partisanship

RECODE FirstQ (1=1) (2=0) INTO FirstQ_re.
RECODE Lean (1=1) (2=0) INTO Lean_re.
RECODE Aff (1=1) (2=0) INTO Aff_re.
RECODE Str (1=1) (2=0) INTO Str_re.

VARIABLE LABELS
Lean_re 'Partisanship'.

VARIABLE LABELS
Aff_re 'Partisanship'.

VALUE LABELS
Lean_re Aff_re
0 "Democrat"
1 "Republican".

COMPUTE Partisanship_combined=Sum(Lean_re, Aff_re). 
EXECUTE.

VARIABLE LABELS
Partisanship_combined 'Partisanship'.

VALUE LABELS
Partisanship_combined
0 "Democrat"
1 "Republican".



******************************************************************
* STEP 2: Create new variable: In-group estimate
******************************************************************

* Immigration

IF  (Partisanship_combined = 0) Dem_Imm_Dis_raw=36 - Imm.
IF  (Partisanship_combined = 1) Rep_Imm_Dis_raw=47 - Imm. 

DESCRIPTIVES VARIABLES=Dem_Imm_Dis_raw Rep_Imm_Dis_raw 
  /STATISTICS=MEAN STDDEV MIN MAX.

*SD = 19.06, 25.80 (Dem, Rep)

RECODE Dem_Imm_Dis_raw (Lowest thru -19.06-.1=1) ( -19.06 thru -5.1=2) (-5 thru 5=3) (5.1 thru 19.06=4) (19.06+.1 thru Highest=5) INTO Dem_Imm_Dis. 
RECODE Rep_Imm_Dis_raw (Lowest thru -25.80-.1=1) ( -25.80 thru -5.1=2) (-5 thru 5=3) (5.1 thru 25.80=4) (25.80+.1 thru Highest=5) INTO Rep_Imm_Dis.

COMPUTE All_Imm_Dis=Sum(Dem_Imm_Dis, Rep_Imm_Dis). 
EXECUTE.

* Russian

IF  (Partisanship_combined = 0) Dem_Russ_Dis_raw=66 - Russ.
IF  (Partisanship_combined = 1) Rep_Russ_Dis_raw=18 - Russ. 

DESCRIPTIVES VARIABLES=Dem_Russ_Dis_raw Rep_Russ_Dis_raw 
  /STATISTICS=MEAN STDDEV MIN MAX.

*SD = 30.79, 17.15 (Dem, Rep)

RECODE Dem_Russ_Dis_raw (Lowest thru -30.79-.1=1) ( -30.79 thru -5.1=2) (-5 thru 5=3) (5.1 thru 30.79=4) (30.79+.1 thru Highest=5) INTO Dem_Russ_Dis. 
RECODE Rep_Russ_Dis_raw (Lowest thru -17.15-.1=1) ( -17.15 thru -5.1=2) (-5 thru 5=3) (5.1 thru 17.15=4) (17.15+.1 thru Highest=5) INTO Rep_Russ_Dis.

COMPUTE All_Russ_Dis=Sum(Dem_Russ_Dis, Rep_Russ_Dis). 
EXECUTE.

* Tax (reversely coded) 

IF  (Partisanship_combined = 0) Dem_High_Dis_raw=43 - High.
IF  (Partisanship_combined = 1) Rep_High_Dis_raw=28 - High. 

DESCRIPTIVES VARIABLES=Dem_High_Dis_raw Rep_High_Dis_raw 
  /STATISTICS=MEAN STDDEV MIN MAX.

*SD = 26.34, 24.90 (Dem, Rep)

RECODE Dem_High_Dis_raw (Lowest thru -26.34-.1=5) ( -26.34 thru -5.1=4) (-5 thru 5=3) (5.1 thru 26.34=2) (26.34+.1 thru Highest=1) INTO Dem_High_Dis. 
RECODE Rep_High_Dis_raw (Lowest thru -24.90-.1=5) ( -24.90 thru -5.1=4) (-5 thru 5=3) (5.1 thru 24.90=2) (24.90+.1 thru Highest=1) INTO Rep_High_Dis.

COMPUTE All_High_Dis=Sum(Dem_High_Dis, Rep_High_Dis). 
EXECUTE.

* Income

IF  (Partisanship_combined = 0) Dem_Incom_Dis_raw=50 - Incom. 
IF  (Partisanship_combined = 1) Rep_Incom_Dis_raw=48 - Incom. 

DESCRIPTIVES VARIABLES=Dem_Incom_Dis_raw Rep_Incom_Dis_raw 
  /STATISTICS=MEAN STDDEV MIN MAX.

*SD = 22.65, 25.23 (Dem, Rep)

RECODE Dem_Incom_Dis_raw (Lowest thru -22.65-.1=1) ( -22.65 thru -5.1=2) (-5 thru 5=3) (5.1 thru 22.65=4) (22.65+.1 thru Highest=5) INTO Dem_Incom_Dis. 
RECODE Rep_Incom_Dis_raw (Lowest thru -25.23-.1=1) ( -25.23 thru -5.1=2) (-5 thru 5=3) (5.1 thru 25.23=4) (25.23+.1 thru Highest=5) INTO Rep_Incom_Dis.

COMPUTE All_Incom_Dis=Sum(Dem_Incom_Dis, Rep_Incom_Dis). 
EXECUTE.

* SNAP (reversly coded)

IF  (Partisanship_combined = 0) Dem_Snap_Dis_raw=37 - Snap. 
IF  (Partisanship_combined = 1) Rep_Snap_Dis_raw=12 - Snap. 

DESCRIPTIVES VARIABLES=Dem_Snap_Dis_raw Rep_Snap_Dis_raw 
  /STATISTICS=MEAN STDDEV MIN MAX.

*SD = 25.75, 24.37 (Dem, Rep)

RECODE Dem_Snap_Dis_raw (Lowest thru -25.75-.1=5) ( -25.75 thru -5.1=4) (-5 thru 5=3) (5.1 thru 25.75=2) (25.75+.1 thru Highest=1) INTO Dem_Snap_Dis. 
RECODE Rep_Snap_Dis_raw (Lowest thru -24.37-.1=5) ( -24.37 thru -5.1=4) (-5 thru 5=3) (5.1 thru 24.37=2) (24.37+.1 thru Highest=1) INTO Rep_Snap_Dis.

COMPUTE All_Snap_Dis=Sum(Dem_Snap_Dis, Rep_Snap_Dis). 
EXECUTE.

* Labeling

VALUE LABELS
Dem_Imm_Dis Rep_Imm_Dis All_Imm_Dis
Dem_Russ_Dis Rep_Russ_Dis All_Russ_Dis
Dem_High_Dis Rep_High_Dis All_High_Dis
Dem_Incom_Dis Rep_Incom_Dis All_Incom_Dis
Dem_Snap_Dis Rep_Snap_Dis All_Snap_Dis
1 "Strongly underestimate"
2 "Underestimate"
3 "Accurate"
4 "Overestimate"
5 "Stronlyg overestimate".

* zero-centering group estimation measures

RECODE All_Imm_Dis (1=-2) (2=-1) (3=0) (4=1) (5=2) INTO All_Imm_Dis_r.
RECODE All_Russ_Dis (1=-2) (2=-1) (3=0) (4=1) (5=2) INTO All_Russ_Dis_r.
RECODE All_High_Dis (1=-2) (2=-1) (3=0) (4=1) (5=2) INTO All_High_Dis_r.
RECODE All_Incom_Dis (1=-2) (2=-1) (3=0) (4=1) (5=2) INTO All_Incom_Dis_r.
RECODE All_Snap_Dis (1=-2) (2=-1) (3=0) (4=1) (5=2) INTO All_Snap_Dis_r.



******************************************************************
* STEP 3: Recode variable
******************************************************************

* My belief to misinformation (The higher score means corrected beliefs)
* Be careful to item 4 and 5

RECODE TRU_1 (40=4) (41=3) (42=2) (43=1) INTO TRU_1_re.
RECODE TRU_2 (40=4) (41=3) (42=2) (43=1) INTO TRU_2_re.
RECODE TRU_3 (40=1) (41=2) (42=3) (43=4) INTO TRU_3_re.
RECODE TRU_4 (40=1) (41=2) (42=3) (43=4) INTO TRU_5_re.
RECODE TRU_5 (40=4) (41=3) (42=2) (43=1) INTO TRU_4_re.

* Identity 2 (Reverse coded: 3, 6)

RECODE ID2_1 (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) INTO ID2_1_re.
RECODE ID2_2 (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) INTO ID2_2_re.
RECODE ID2_3 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1) INTO ID2_3_re.
RECODE ID2_4 (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) INTO ID2_4_re.
RECODE ID2_5 (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) INTO ID2_5_re.
RECODE ID2_6 (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1) INTO ID2_6_re.
RECODE ID2_7 (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) INTO ID2_7_re.
RECODE ID2_8 (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) INTO ID2_8_re.

* Demographics

RECODE GENDER (1=0) (2=1) (4=SYSMIS) INTO  GENDER_re.
RECODE EDU (4=1) (5=2) (6=3) (7=4) (8=5) (9=6) (10=7) (11=8) (14=9) INTO EDU_re.
RECODE INT (1=4) (2=3) (3=2) (4=1) INTO INT_re.
RECODE RACE_1 (1=1) (SYSMIS = 0) INTO Race_1_re.

VARIABLE LABELS
GENDER_re 'Gender'.

VALUE LABELS
GENDER_re
0 "Female"
1 "Male".

VARIABLE LABELS
RACE_1_re 'Race'.

VALUE LABELS
RACE_1_re
0 "Others"
1 "Caucasian".



******************************************************************
* STEP 4: Cronbach alpha and composite variable
******************************************************************

* (1) Identity 2 (Cronbach alpha = .813)

RELIABILITY 
  /VARIABLES=ID2_1_re ID2_2_re ID2_3_re ID2_4_re ID2_5_re ID2_6_re ID2_7_re ID2_8_re
  /SCALE('ALL VARIABLES') ALL 
  /MODEL=ALPHA.

COMPUTE ID2_mean=(ID2_1_re+ID2_2_re+ID2_3_re+ID2_4_re+ID2_5_re+ID2_6_re+ID2_7_re+ID2_8_re)/8. 
EXECUTE.

* dichotomize - ID2_mean (0 = ID2mean < 4.00, 1 = ID2mean > 4.01)

RECODE ID2_mean (0 thru 3.99=0) (4.00 thru 10=1) INTO Identity. 
EXECUTE.


